Valid Parenthesis String - Leetcode 678 - Python